package eerbaar.client.internal.ctr.cmd;

import eerbaar.client.ctr.IPersonaCmd;

public class PersonaCmdFactory {

    public static IPersonaCmd getCmd(String inName) {
        assert (inName != null);

        String name = inName;

        name = name.toLowerCase();
        IPersonaCmd cmd = null;

        if (name.equals(":decrementy")) {
            cmd = new DecrementYCmd();
        }
        if (name.equals(":incrementy")) {
            cmd = new IncrementYCmd();
        }
        if (name.equals(":decrementx")) {
            cmd = new DecrementXCmd();
        }
        if (name.equals(":incrementx")) {
            cmd = new IncrementXCmd();
        }
        if (name.equals(":decrementxdecrementy")) {
            cmd = new DecrementXDecrementYCmd();
        }
        if (name.equals(":decrementxincrementy")) {
            cmd = new DecrementXIncrementYCmd();
        }
        if (name.equals(":incrementxdecrementy")) {
            cmd = new IncrementXDecrementYCmd();
        }
        if (name.equals(":incrementyincrementy")) {
            cmd = new IncrementXIncrementYCmd();
        }

        return cmd;
    }

    static public IPersonaCmd moveDown() {
        return new IncrementYCmd();
    }

    static public IPersonaCmd moveLeft() {
        return new IncrementXCmd();
    }

    static public IPersonaCmd moveRight() {
        return new DecrementXCmd();
    }

    static public IPersonaCmd moveUp() {
        return new DecrementYCmd();
    }

    private PersonaCmdFactory() {
        //
    }

}
